/*!
 * \file nuApplication.h
 * \brief Nude's application.
 * \author Nus
 * \date 2008/02/16, 22:18
 */

#ifndef __NUAPPLICATION_H__
#define __NUAPPLICATION_H__

#include "nuRect.h"
#include "nuObject.h"

/*!
 * \class nuApplication.
 * \brief Nude's application class.
 * Do not instance this class directly. Instead, derive & inherit
 * attributes from this class. Instance the derived class to create
 * your application object.
 */
class nuApplication : public nuObject
{
  BEGIN_RTTI_DECL(nuApplication);
    RTTI_DECL(nuApplication, nuObject);
  END_RTTI_DECL(nuApplication);

public:
  //! \brief Default constructor.
  nuApplication();
  
  //! \brief Default destructor.
  virtual ~nuApplication();
  
  //! \brief Initialize application.
  virtual s32 initApp(void);

  //! \brief Run application.
  virtual s32 runApp(void);

  //! \brief Terminate application.
  virtual s32 termApp(void);
  
  //! \brief Resize.
  virtual void procResize(const nuRect& rect) = 0;
  
  //! \brief Process key input.
  virtual void procInput(s32 state, s32 key) = 0;
  
  //! \brief Process pointing devices.
  virtual void procPointingDev(s32 state, const nuPoint& point) = 0;

  //! \brief Get state.
  s32 getState(void) {
    return mState;
  }

protected:
  s32 mState;                     //!< State.
  
  //! \brief Initializing procedure.
  virtual s32 initProc(void);

  //! \brief Main procedure.
  virtual s32 mainProc(void);

  //! \brief Terminating procedure.
  virtual s32 termProc(void);

private:
  // None...

};

#endif
